<?php
/**
 * Created by PhpStorm.
 * User: czw
 * Date: 2018/7/11
 * Time: 14:59
 */
namespace app\common\model;

use app\lib\exception\BaseException;
use think\Model;

class Store extends Model
{
    public static function getAll(){
        return self::select();
    }
    public static function createOne($data){
        $model = new self();
        $res = $model->allowField(true)->create($data);
        if(!$res) throw new BaseException(['msg'=>'添加门店失败！']);
        return $res;
    }
}